<template>
  <div>
    <!-- <v-button
      v-for="item in arr"
      :key="item.id"
      @click="$router.push('/list?id=' + item.id)"
    >
       {{ item.catename }} 
    </v-button> -->
     <van-tabs @click="tiao">
      <van-tab v-for="item in arr"
      :key="item.id" :title="item.catename">
         
      </van-tab>
    </van-tabs>
  </div>
</template>

<script>
import vButton from '../../../../../app/src/components/vButton.vue';
import { reqhomecate } from "../../../http/http";
export default {
  components: { vButton },
  data() {
    return {
      arr: [],
    };
  },
  mounted() {
    reqhomecate().then((res) => {
      console.log(res);
      this.arr = res.data.list;
    });
  },
  methods: {
    tiao(index){
      this.$router.push("/list?id="+this.arr[index].id)
    }
  },
};
</script>

<style scoped>
</style>
